Web APIçµ±åãã¿ãŒã³ã®å æ¬çã¬ã€ããå ç¢ã§ã¹ã±ãŒã©ãã«ãªã°ããŒãã«ã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããããã®æŠç¥ãæ¢ããŸããæ§ã ãªçµ±åæè¡ãšãã¹ããã©ã¯ãã£ã¹ãåŠã³ãŸãããã
Web APIïŒã°ããŒãã«ã¢ããªã±ãŒã·ã§ã³ã®ããã®çµ±åãã¿ãŒã³
Web APIïŒã¢ããªã±ãŒã·ã§ã³ã»ããã°ã©ãã³ã°ã»ã€ã³ã¿ãŒãã§ãŒã¹ïŒã¯ãçŸä»£ã®ãœãããŠã§ã¢ã¢ãŒããã¯ãã£ã®æ ¹å¹¹ããªããç°ãªãã·ã¹ãã éã®ã·ãŒã ã¬ã¹ãªéä¿¡ãšããŒã¿äº€æãå¯èœã«ããŸãã仿¥ã®ã°ããŒãã«ã«çžäºæ¥ç¶ãããäžçã§ã¯ãå ç¢ã§ã¹ã±ãŒã©ãã«ããã€ä¿å®æ§ã®é«ãã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããããã«ãããŸããŸãªAPIçµ±åãã¿ãŒã³ãçè§£ããããšã極ããŠéèŠã§ãããã®å æ¬çãªã¬ã€ãã§ã¯ãæ§ã ãªçµ±åãã¿ãŒã³ããã®å©ç¹ãæ¬ ç¹ããŠãŒã¹ã±ãŒã¹ãæ¢ããã°ããŒãã«ãããžã§ã¯ãã«ãããŠæ å ±ã«åºã¥ããæææ±ºå®ãè¡ãããã®ç¥èãæäŸããŸãã
APIçµ±åãã¿ãŒã³ãšã¯ïŒ
APIçµ±åãã¿ãŒã³ã¯ãç°ãªãã¢ããªã±ãŒã·ã§ã³ããµãŒãã¹ãAPIãä»ããŠã©ã®ããã«æ¥ç¶ããçžäºäœçšããããå®çŸ©ããã¢ãŒããã¯ãã£ã®èšèšå³ã§ãããããã®ãã¿ãŒã³ã¯ãããŒã¿å€æããšã©ãŒãã³ããªã³ã°ãã»ãã¥ãªãã£ãã¹ã±ãŒã©ããªãã£ãšãã£ãäžè¬çãªçµ±åã®èª²é¡ã解決ããããã®æšæºåãããã¢ãããŒããæäŸããŸããAPIé§ååã¢ããªã±ãŒã·ã§ã³ã®æåã確å®ã«ããããã«ã¯ãé©åãªçµ±åãã¿ãŒã³ãéžæããããšãäžå¯æ¬ ã§ãã
äžè¬çãªAPIçµ±åãã¿ãŒã³
以äžã¯ãçŸä»£ã®ãœãããŠã§ã¢éçºã§äœ¿çšãããæãäžè¬çãªAPIçµ±åãã¿ãŒã³ã§ãïŒ
1. ãªã¯ãšã¹ã/ã¬ã¹ãã³ã¹ïŒåæïŒ
ããã¯æãåºæ¬çã§åºã䜿çšãããŠãããã¿ãŒã³ã§ããäžã€ã®ã¢ããªã±ãŒã·ã§ã³ïŒã¯ã©ã€ã¢ã³ãïŒãAPIãšã³ããã€ã³ããä»ããŠå¥ã®ã¢ããªã±ãŒã·ã§ã³ïŒãµãŒããŒïŒã«ãªã¯ãšã¹ããéä¿¡ãããµãŒããŒã¯å³åº§ã«ãªã¯ãšã¹ããåŠçããŠã¬ã¹ãã³ã¹ãè¿ããŸããã¯ã©ã€ã¢ã³ãã¯åŠçãç¶è¡ããåã«ã¬ã¹ãã³ã¹ãåŸ ã¡ãŸãã
ç¹åŸŽïŒ
- åæéä¿¡ïŒ ãµãŒããŒãå¿çãããŸã§ã¯ã©ã€ã¢ã³ãã¯ãããã¯ãããŸãã
- ãªã¢ã«ã¿ã€ã ããŒã¿ïŒ 峿ã®ããŒã¿ãå¿ èŠãªã·ããªãªã«é©ããŠããŸãã
- ã·ã³ãã«ãªå®è£ ïŒ æ¯èŒçå®è£ ãšçè§£ã容æã§ãã
ãŠãŒã¹ã±ãŒã¹ïŒ
- ããŒã¿ããŒã¹ãããŠãŒã¶ãŒãããã¡ã€ã«æ å ±ãååŸããã
- æ¯æããã©ã³ã¶ã¯ã·ã§ã³ãåŠçããã
- ãŠãŒã¶ãŒèªèšŒæ å ±ãæ€èšŒããã
äŸïŒ ã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ãéè¡ã®APIãããŠãŒã¶ãŒã®å£åº§æ®é«ãèŠæ±ããå Žåãã¢ããªã±ãŒã·ã§ã³ã¯APIããã®ã¬ã¹ãã³ã¹ãåãåã£ãåŸã«ã®ã¿æ®é«ã衚瀺ããŸãã
2. éåæã¡ãã»ãŒãžã³ã°
ãã®ãã¿ãŒã³ã§ã¯ãã¢ããªã±ãŒã·ã§ã³ã¯ã¡ãã»ãŒãžãã¥ãŒããããã¯ãä»ããŠéä¿¡ããŸããã¯ã©ã€ã¢ã³ãã¯ã¬ã¹ãã³ã¹ãåŸ ããã«ãã¥ãŒã«ã¡ãã»ãŒãžãéä¿¡ããŸããå¥ã®ã¢ããªã±ãŒã·ã§ã³ïŒã³ã³ã·ã¥ãŒããŒïŒããã¥ãŒããã¡ãã»ãŒãžãååŸããŠåŠçããŸãããã®ãã¿ãŒã³ã¯éä¿¡è ãšåä¿¡è ãåé¢ããããã¹ã±ãŒã©ãã«ã§å埩åã®ããã·ã¹ãã ãå¯èœã«ããŸãã
ç¹åŸŽïŒ
- åé¢ãããéä¿¡ïŒ éä¿¡è ãšåä¿¡è ãåæã«ãªã³ã©ã€ã³ã§ããå¿ èŠã¯ãããŸããã
- ã¹ã±ãŒã©ããªãã£ïŒ ç¬ç«ãããµãŒãã¹ãã¹ã±ãŒã«ãããããã§ãã
- ä¿¡é Œæ§ïŒ ã¡ãã»ãŒãžãã¥ãŒã¯ç¢ºå®ãªé ä¿¡ãæäŸããŸãã
ãŠãŒã¹ã±ãŒã¹ïŒ
- ããã¯ã°ã©ãŠã³ãã§å€§éã®ããŒã¿ãåŠçããã
- ã¡ãŒã«éç¥ãéä¿¡ããã
- Eã³ããŒã¹ã·ã¹ãã ã§åšåº«ã¬ãã«ãæŽæ°ããã
äŸïŒ ãŠãŒã¶ãŒãEã³ããŒã¹ãµã€ãã§æ³šæãããšãã¡ãã»ãŒãžãã¡ãã»ãŒãžãã¥ãŒã«éä¿¡ãããŸããå¥ã®ãµãŒãã¹ãã¡ãã»ãŒãžãååŸããæ³šæãåŠçããŠããŠãŒã¶ãŒã«ç¢ºèªã¡ãŒã«ãéä¿¡ããŸãããŠã§ããµã€ãã¯ããŠãŒã¶ãŒã«æ³šæç¢ºèªã衚瀺ããåã«æ³šæåŠçãå®äºããã®ãåŸ ã€å¿ èŠã¯ãããŸããã
3. ãããªãã·ã¥/ãµãã¹ã¯ã©ã€ãïŒPub/SubïŒ
ãããªãã·ã¥/ãµãã¹ã¯ã©ã€ããã¿ãŒã³ã«ãããã¢ããªã±ãŒã·ã§ã³ã¯äžå€®ã®ã€ãã³ããã¹ã«ã€ãã³ããçºè¡ã§ããä»ã®ã¢ããªã±ãŒã·ã§ã³ã¯ãããã®ã€ãã³ãããµãã¹ã¯ã©ã€ãããŠãã€ãã³ãçºçæã«éç¥ãåãåãããšãã§ããŸãããã®ãã¿ãŒã³ã¯ãã¢ããªã±ãŒã·ã§ã³ããªã¢ã«ã¿ã€ã ã§å€åã«åå¿ããå¿ èŠãããã€ãã³ãé§ååã¢ãŒããã¯ãã£ãæ§ç¯ããã®ã«çæ³çã§ãã
ç¹åŸŽïŒ
- ã€ãã³ãé§åïŒ ã¢ããªã±ãŒã·ã§ã³ãã€ãã³ãã«åå¿ããŸãã
- ãªã¢ã«ã¿ã€ã éç¥ïŒ ãµãã¹ã¯ã©ã€ããŒã¯å³æã®æŽæ°ãåãåããŸãã
- ççµåïŒ ãããªãã·ã£ãŒãšãµãã¹ã¯ã©ã€ããŒã¯ç¬ç«ããŠããŸãã
ãŠãŒã¹ã±ãŒã¹ïŒ
- ãªã¢ã«ã¿ã€ã ã®æ ªåŒåžå Žã®æŽæ°ã
- ãœãŒã·ã£ã«ã¡ãã£ã¢ã®éç¥ã
- IoTïŒã¢ãã®ã€ã³ã¿ãŒãããïŒã»ã³ãµãŒããŒã¿ã®åŠçã
äŸïŒ ã¹ããŒãããŒã ã®ã»ã³ãµãŒã枩床ã®èªã¿åãå€ãã€ãã³ããã¹ã«çºè¡ããŸãããµãŒã¢ã¹ã¿ãããèŠå ±ã·ã¹ãã ãªã©ã®ç°ãªãã¢ããªã±ãŒã·ã§ã³ã枩床ã€ãã³ãããµãã¹ã¯ã©ã€ãããããã«å¿ããŠåå¿ããŸãïŒäŸïŒæž©åºŠã調æŽããããŸãã¯æž©åºŠãé«ãããå Žåã«èŠå ±ãçºããïŒã
4. ãããåŠç
ãã®ãã¿ãŒã³ã¯ã倧éã®ããŒã¿ããããã§åŠçããããšãå«ã¿ãŸããããŒã¿ã¯äžå®æéã«ããã£ãŠåéããããã®åŸäžåºŠã®æäœã§åŠçãããŸãããããåŠçã¯ãããŒã¿ãŠã§ã¢ããŠãžã³ã°ãã¬ããŒãäœæãåæã«ãã䜿çšãããŸãã
ç¹åŸŽïŒ
- é«ã¹ã«ãŒãããïŒ å€§èŠæš¡ãªããŒã¿ã»ããã®åŠççšã«èšèšãããŠããŸãã
- ã¹ã±ãžã¥ãŒã«å®è¡ïŒ éåžžã¯ã¹ã±ãžã¥ãŒã«ã«åºã¥ããŠå®è¡ãããŸãã
- ã³ã¹ãå¹çïŒ å€§èŠæš¡ãªããŒã¿åŠçã«ãããŠããå¹ççã§ãã
ãŠãŒã¹ã±ãŒã¹ïŒ
- ææ¬¡ã®è²¡åã¬ããŒããçæããã
- ããŒã¿ããŒã¹ã®å€éããã¯ã¢ãããå®è¡ããã
- ãŠã§ããµã€ãã®ãã©ãã£ãã¯ããŒã¿ãåæããã
äŸïŒ éä¿¡äŒç€Ÿãäžæ¥ãéããŠé話詳现èšé²ïŒCDRïŒãåéããŸããäžæ¥ã®çµããã«ãããåŠçãå®è¡ãããCDRãåæããè«æ±æžãçæãããããã¯ãŒã¯å©çšãã¿ãŒã³ãç¹å®ããŸãã
5. ãªãŒã±ã¹ãã¬ãŒã·ã§ã³
ãã®ãã¿ãŒã³ã§ã¯ãäžå€®ã®ãªãŒã±ã¹ãã¬ãŒã¿ãŒãµãŒãã¹ãè€æ°ã®ãµãŒãã¹ã«ãããäžé£ã®APIåŒã³åºãã®å®è¡ã管çããŸãããªãŒã±ã¹ãã¬ãŒã¿ãŒã¯ãã¯ãŒã¯ãããŒã®èª¿æŽããšã©ãŒã®åŠçãããã³ãã¹ãŠã®ã¹ããããæ£ããé åºã§å®äºããããšãä¿èšŒãã責任ããããŸãã
ç¹åŸŽïŒ
- éäžç®¡çïŒ ãªãŒã±ã¹ãã¬ãŒã¿ãŒãã¯ãŒã¯ãããŒå šäœã管çããŸãã
- è€éãªã¯ãŒã¯ãããŒïŒ è€éãªããžãã¹ããã»ã¹ã«é©ããŠããŸãã
- å¯çµåïŒ ãªãŒã±ã¹ãã¬ãŒã¿ãŒã¯ç®¡çãããµãŒãã¹ãšå¯æ¥ã«çµåããŠããŸãã
ãŠãŒã¹ã±ãŒã¹ïŒ
- ããŒã³ç³è«ãåŠçããã
- Eã³ããŒã¹ã®æ³šæãåŠçããã
- æ°èŠé¡§å®¢ã®ãªã³ããŒãã£ã³ã°ãè¡ãã
äŸïŒ 顧客ããªã³ã©ã€ã³ã§ããŒã³ãç³è«ãããšããªãŒã±ã¹ãã¬ãŒã·ã§ã³ãµãŒãã¹ãããã»ã¹å šäœã管çããŸãããªãŒã±ã¹ãã¬ãŒã¿ãŒã¯ã顧客ã®èº«å ã確èªããä¿¡çšã¹ã³ã¢ããã§ãã¯ããããŒã³ãæ¿èªããããã«ç°ãªããµãŒãã¹ãåŒã³åºããŸãããªãŒã±ã¹ãã¬ãŒã¿ãŒã¯ãããã»ã¹äžã«çºçãããšã©ãŒãåŠçããããŒã³ãæ¿èªãããåã«ãã¹ãŠã®ã¹ããããå®äºããããšãä¿èšŒããŸãã
6. ã³ã¬ãªã°ã©ãã£
ãªãŒã±ã¹ãã¬ãŒã·ã§ã³ãšã¯ç°ãªããã³ã¬ãªã°ã©ãã£ã¯ã¯ãŒã¯ãããŒããžãã¯ãè€æ°ã®ãµãŒãã¹ã«åæ£ãããŸããåãµãŒãã¹ã¯ããã»ã¹ã®èªèº«ã®éšåã«è²¬ä»»ãæã¡ãã€ãã³ããä»ããŠä»ã®ãµãŒãã¹ãšéä¿¡ããŸãããã®ãã¿ãŒã³ã¯ççµåãä¿é²ããããæè»ã§ã¹ã±ãŒã©ãã«ãªã·ã¹ãã ãå¯èœã«ããŸãã
ç¹åŸŽïŒ
- 忣å¶åŸ¡ïŒ äžå€®ã®ãªãŒã±ã¹ãã¬ãŒã¿ãŒã¯ååšããŸããã
- ççµåïŒ ãµãŒãã¹ã¯ã€ãã³ããä»ããŠéä¿¡ããŸãã
- ã¹ã±ãŒã©ããªãã£ïŒ åã ã®ãµãŒãã¹ãã¹ã±ãŒã«ãããããã§ãã
ãŠãŒã¹ã±ãŒã¹ïŒ
- 忣ã·ã¹ãã ã§ãã€ã¯ããµãŒãã¹ã管çããã
- ãªã¢ã«ã¿ã€ã ã®ããŒã¿ãã€ãã©ã€ã³ãæ§ç¯ããã
- è€éãªããžãã¹ããã»ã¹ãå®è£ ããã
äŸïŒ Eã³ããŒã¹ãã©ãããã©ãŒã ã®ãã€ã¯ããµãŒãã¹ã¢ãŒããã¯ãã£ã§ã¯ãåãµãŒãã¹ïŒäŸïŒè£œåã«ã¿ãã°ãã·ã§ããã³ã°ã«ãŒããæ³šæç®¡çïŒãããã»ã¹ã®èªèº«ã®éšåã«è²¬ä»»ãæã¡ãŸãããŠãŒã¶ãŒãååãã·ã§ããã³ã°ã«ãŒãã«è¿œå ãããšã補åã«ã¿ãã°ãµãŒãã¹ãã€ãã³ããçºè¡ããŸããã·ã§ããã³ã°ã«ãŒããµãŒãã¹ã¯ãã®ã€ãã³ãããµãã¹ã¯ã©ã€ããããŠãŒã¶ãŒã®ã·ã§ããã³ã°ã«ãŒããããã«å¿ããŠæŽæ°ããŸãããã®ã³ã¬ãªã°ã©ãã£ãã¿ãŒã³ã«ãããç°ãªããµãŒãã¹ã坿¥ã«çµåããããšãªã飿ºã§ããŸãã
7. APIã²ãŒããŠã§ã€
APIã²ãŒããŠã§ã€ã¯ããã¹ãŠã®APIãªã¯ãšã¹ãã®åäžã®ãšã³ããªãŒãã€ã³ããšããŠæ©èœããŸããã¯ã©ã€ã¢ã³ããšããã¯ãšã³ããµãŒãã¹ã®éã«æœè±¡åã¬ã€ã€ãŒãæäŸããèªèšŒãèªå¯ãã¬ãŒãå¶éããªã¯ãšã¹ã倿ãªã©ã®æ©èœãå¯èœã«ããŸããAPIã²ãŒããŠã§ã€ã¯ããã€ã¯ããµãŒãã¹ã¢ãŒããã¯ãã£ã§APIã管çããä¿è·ããããã«äžå¯æ¬ ã§ãã
ç¹åŸŽïŒ
- éäžç®¡çïŒ ãã¹ãŠã®APIã®åäžã®ãšã³ããªãŒãã€ã³ãã
- ã»ãã¥ãªãã£ïŒ èªèšŒãšèªå¯ãæäŸããŸãã
- ãã©ãã£ãã¯ç®¡çïŒ ã¬ãŒãå¶éãšã¹ããããªã³ã°ãå®è£ ããŸãã
ãŠãŒã¹ã±ãŒã¹ïŒ
- ãã€ã¯ããµãŒãã¹APIãä¿è·ããã
- APIãã©ãã£ãã¯ã管çããã
- APIããŒãžã§ãã³ã°ãå®è£ ããã
äŸïŒ ããäŒæ¥ãAPIã²ãŒããŠã§ã€ãä»ããŠå éšãµãŒãã¹ãå ¬éããŸããã²ãŒããŠã§ã€ã¯ãŠãŒã¶ãŒãèªèšŒããç¹å®ã®APIãžã®ã¢ã¯ã»ã¹ãèªå¯ããåãŠãŒã¶ãŒãè¡ãããªã¯ãšã¹ãã®æ°ãå¶éããŸããããã«ãããããã¯ãšã³ããµãŒãã¹ãäžæ£ã¢ã¯ã»ã¹ãéè² è·ããä¿è·ããŸãã
é©åãªçµ±åãã¿ãŒã³ã®éžæ
é©åãªAPIçµ±åãã¿ãŒã³ã®éžæã¯ã以äžãå«ãããã€ãã®èŠå ã«äŸåããŸãïŒ
- çµ±åã®è€éãïŒ åçŽãªçµ±åã¯ãªã¯ãšã¹ã/ã¬ã¹ãã³ã¹ãã¿ãŒã³ã ãã§ååãªå ŽåããããŸãããããè€éãªçµ±åã¯ãªãŒã±ã¹ãã¬ãŒã·ã§ã³ãã³ã¬ãªã°ã©ãã£ããæ©æµãåããå¯èœæ§ããããŸãã
- ããã©ãŒãã³ã¹èŠä»¶ïŒ éåæã¡ãã»ãŒãžã³ã°ãšãããåŠçã¯å€§éã®ããŒã¿åŠçã«é©ããŠããŸããããªã¯ãšã¹ã/ã¬ã¹ãã³ã¹ã¯ãªã¢ã«ã¿ã€ã ããŒã¿ã«é©ããŠããŸãã
- ã¹ã±ãŒã©ããªãã£èŠä»¶ïŒ éåæã¡ãã»ãŒãžã³ã°ããããªãã·ã¥/ãµãã¹ã¯ã©ã€ããã³ã¬ãªã°ã©ãã£ã¯ççµåãä¿é²ããããã¹ã±ãŒã©ãã«ãªã·ã¹ãã ãå¯èœã«ããŸãã
- ã»ãã¥ãªãã£èŠä»¶ïŒ APIã²ãŒããŠã§ã€ã¯ãAPIã«éäžåãããã»ãã¥ãªãã£ã¬ã€ã€ãŒãæäŸã§ããŸãã
- äºç®ã®å¶çŽïŒ äžéšã®çµ±åãã¿ãŒã³ã¯å®è£ ãããè€éã§ãããå€ãã®ãªãœãŒã¹ãå¿ èŠãšããŸãã
APIçµ±åã®ãã¹ããã©ã¯ãã£ã¹
APIãçµ±åããéã«åŸãã¹ãããã€ãã®ãã¹ããã©ã¯ãã£ã¹ã以äžã«ç€ºããŸãïŒ
- æç¢ºãªç®çãæã£ãŠAPIãèšèšããïŒ åAPIã¯æç¢ºã«å®çŸ©ãããç®çãšç¯å²ãæã€ã¹ãã§ãã
- äžè²«ããAPIèšèšã䜿çšããïŒ RESTãGraphQLãªã©ã®ç¢ºç«ãããAPIèšèšååã«åŸããŸãã
- é©åãªèªèšŒãšèªå¯ãå®è£ ããïŒ OAuth 2.0ãJWTãªã©ã®é©åãªã»ãã¥ãªãã£ã¡ã«ããºã ã§APIãä¿è·ããŸãã
- ãšã©ãŒãé©åã«åŠçããïŒ ã¯ã©ã€ã¢ã³ããåé¡ããã©ãã«ã·ã¥ãŒãã£ã³ã°ããã®ã«åœ¹ç«ã€æ å ±çãªãšã©ãŒã¡ãã»ãŒãžãæäŸããŸãã
- APIã®ããã©ãŒãã³ã¹ãç£èŠããïŒ APIã®äœ¿çšç¶æ³ãšããã©ãŒãã³ã¹ã远跡ããŠãããã«ããã¯ãç¹å®ããããã©ãŒãã³ã¹ãæé©åããŸãã
- APIãææžåããïŒ éçºè ãAPIã®äœ¿ç𿹿³ãçè§£ããã®ã«åœ¹ç«ã€æç¢ºã§å æ¬çãªããã¥ã¡ã³ããæäŸããŸããAPIããã¥ã¡ã³ãã«ã¯Swagger/OpenAPIãªã©ã®ããŒã«ã®äœ¿çšãæ€èšããŠãã ããã
- ããŒãžã§ãã³ã°ãå®è£ ããïŒ æ¢åã®ã¯ã©ã€ã¢ã³ããå£ãããšãªãAPIãžã®å€æŽã管çããããã«APIããŒãžã§ãã³ã°ã䜿çšããŸãã
- APIã®ã¹ããããªã³ã°ãšã¬ãŒãå¶éãæ€èšããïŒ ã¬ãŒãå¶éãšã¹ããããªã³ã°ãå®è£ ããŠãAPIãä¹±çšããä¿è·ããŸãã
ã°ããŒãã«ã¢ããªã±ãŒã·ã§ã³ã®ããã®APIã»ãã¥ãªãã£èæ ®äºé
ã°ããŒãã«ãªæèã§Web APIãä¿è·ããããšã¯ãç¹æã®èª²é¡ããããããŸãã以äžã«ããã€ãã®äž»èŠãªèæ ®äºé ã瀺ããŸãïŒ
- ããŒã¿ã¬ãžãã³ã·ãŒãšã³ã³ãã©ã€ã¢ã³ã¹ïŒ ç°ãªãå°åã®ããŒã¿ã¬ãžãã³ã·ãŒèŠä»¶ãšã³ã³ãã©ã€ã¢ã³ã¹èŠå¶ïŒäŸïŒGDPR, CCPAïŒã«æ³šæããŠãã ãããããŒã¿ãåŠçã»ä¿åããéã«ãAPIããããã®èŠå¶ã«æºæ ããŠããããšã確èªããŠãã ãããã¬ãžãã³ã·ãŒèŠä»¶ãæºããããã«ãå°åå¥ã®APIã²ãŒããŠã§ã€ãšããŒã¿ä¿åå Žæã®äœ¿çšãæ€èšããŠãã ããã
- ã°ããŒããªãŒãŒã·ã§ã³ïŒg11nïŒãšããŒã«ãªãŒãŒã·ã§ã³ïŒl10nïŒïŒ è€æ°ã®èšèªãšé貚ããµããŒãããããã«APIãèšèšããŸããæšæºã®æ¥æåœ¢åŒã䜿çšããŠãã ããããšã©ãŒã¡ãã»ãŒãžãšããã¥ã¡ã³ãã¯ãŠãŒã¶ãŒã®åªå èšèªã§è¿ããŸãã
- ãªãªãžã³éãªãœãŒã¹å ±æïŒCORSïŒïŒ èªå¯ããããã¡ã€ã³ããã®ãªã¯ãšã¹ããèš±å¯ããããã«CORSãé©åã«èšå®ããŸããã¯ã€ã«ãã«ãŒãCORSèšå®ã®ã»ãã¥ãªãã£äžã®åœ±é¿ã«æ³šæããŠãã ããã
- IPãã¯ã€ããªã¹ãç»é²ãšãã©ãã¯ãªã¹ãç»é²ïŒ IPãã¯ã€ããªã¹ãã䜿çšããŠãAPIãžã®ã¢ã¯ã»ã¹ãèªå¯ãããIPã¢ãã¬ã¹ãŸãã¯ç¯å²ã«å¶éããŸããæ¢ç¥ã®æªæã®ããã¢ã¯ã¿ãŒããã®æªè³ªãªãã©ãã£ãã¯ããããã¯ããããã«IPãã©ãã¯ãªã¹ããå®è£ ããŸãã
- APIããŒç®¡çïŒ APIããŒãå®å šã«ç®¡çããã¯ã©ã€ã¢ã³ããµã€ãã®ã³ãŒããå ¬éãªããžããªã§å ¬éãããªãããã«ããŸããAPIããŒãæå·åããŠä¿åããããã«ããŒç®¡çã·ã¹ãã ïŒKMSïŒã®äœ¿çšãæ€èšããŠãã ããã
- å ¥åæ€èšŒãšãµãã¿ã€ãŒãŒã·ã§ã³ïŒ ã€ã³ãžã§ã¯ã·ã§ã³æ»æïŒäŸïŒSQLã€ã³ãžã§ã¯ã·ã§ã³ãã¯ãã¹ãµã€ãã¹ã¯ãªããã£ã³ã°ïŒãé²ãããã«ããã¹ãŠã®APIå ¥åãæ€èšŒãããµãã¿ã€ãºããŸããSQLã€ã³ãžã§ã¯ã·ã§ã³ã®ãªã¹ã¯ã軜æžããããã«ããã©ã¡ãŒã¿åã¯ãšãªãšããªãã¢ãã¹ããŒãã¡ã³ãã䜿çšããŸãã
- 宿çãªã»ãã¥ãªãã£ç£æ»ïŒ æœåšçãªè匱æ§ãç¹å®ãã察åŠããããã«ãAPIã®å®æçãªã»ãã¥ãªãã£ç£æ»ã宿œããŸããèªåã¹ãã£ã³ããŒã«ãšäŸµå ¥ãã¹ãã䜿çšããŠãAPIã®ã»ãã¥ãªãã£äœå¶ãè©äŸ¡ããŸãã
APIçµ±åã®å®äžçã§ã®äŸ
以äžã¯ãAPIçµ±åãã¿ãŒã³ãããŸããŸãªæ¥çã§ã©ã®ããã«äœ¿çšãããŠãããã®å®äžçã®äŸã§ãïŒ
- Eã³ããŒã¹ïŒ Eã³ããŒã¹ãã©ãããã©ãŒã ã¯ã決æžã²ãŒããŠã§ã€ãé 鿥è ãåšåº«ç®¡çã·ã¹ãã ãšçµ±åããããã«APIã䜿çšããŸãã
- ãã«ã¹ã±ã¢ïŒ ãã«ã¹ã±ã¢æäŸè ã¯ãé»åå¥åº·èšé²ïŒEHRïŒã·ã¹ãã ãæ€æ»ã·ã¹ãã ãè¬å±ã·ã¹ãã ãšçµ±åããããã«APIã䜿çšããŸãã
- éèïŒ éèæ©é¢ã¯ãä¿¡çšèª¿æ»æ©é¢ã決æžåŠçæ¥è ãäžæ£æ€åºã·ã¹ãã ãšçµ±åããããã«APIã䜿çšããŸãã
- æ è¡ïŒ ãªã³ã©ã€ã³æ è¡ä»£çåºã¯ãèªç©ºäŒç€Ÿãããã«ãã¬ã³ã¿ã«ãŒäŒç€Ÿãšçµ±åããããã«APIã䜿çšããŸãã
å ·äœçãªåœéçãªäŸïŒ
- ã¢ããªã«ã®ã¢ãã€ã«æ±ºæžïŒ å€ãã®ã¢ããªã«è«žåœã¯ãM-Pesaã®ãããªã¢ãã€ã«ãããŒãµãŒãã¹ã«å€§ããäŸåããŠããŸããAPIã¯ãã¢ãã€ã«ãŠã©ã¬ãããšæ§ã ãªããžãã¹éã®ã·ãŒã ã¬ã¹ãªçµ±åãå¯èœã«ãããªã³ã©ã€ã³ããã³ãªãã©ã€ã³ã®ååŒãä¿é²ããŸãã
- æ±åã¢ãžã¢ã®è¶å¢ECïŒ æ±åã¢ãžã¢ã®Eã³ããŒã¹ãã©ãããã©ãŒã ã¯ãè€æ°ã®åœã®ç©æµãããã€ããŒãšçµ±åããããã«APIã䜿çšããåœå¢ãè¶ããé éãšéé¢ãå¯èœã«ããŸãã
- ãšãŒãããã®ãªãŒãã³ãã³ãã³ã°ïŒ ãšãŒãããã®æ±ºæžãµãŒãã¹æä»€ç¬¬2çïŒPSD2ïŒã¯ããªãŒãã³ãã³ãã³ã°APIã矩åä»ããŠããããµãŒãããŒãã£ãããã€ããŒã顧客ã®åæãåŸãŠé¡§å®¢ã®å£åº§æ å ±ã«ã¢ã¯ã»ã¹ããæ¯æããéå§ããããšãå¯èœã«ããŠããŸãã
APIçµ±åã®æªæ¥
APIçµ±åã®æªæ¥ã¯ã以äžãå«ãããã€ãã®ãã¬ã³ãã«ãã£ãŠåœ¢äœãããå¯èœæ§ããããŸãïŒ
- ãã€ã¯ããµãŒãã¹ã®å°é ïŒ ãã€ã¯ããµãŒãã¹ã¢ãŒããã¯ãã£ã®äººæ°ãé«ãŸã£ãŠãããããæŽç·ŽãããAPIçµ±åãã¿ãŒã³ã®å¿ èŠæ§ãé«ãŸã£ãŠããŸãã
- APIãšã³ãããŒã®æé·ïŒ APIã¯ããžãã¹ã«ãšã£ãŠè²Žéãªè³ç£ãšãªãã€ã€ãããæ°ããAPIé§åã®ããžãã¹ã¢ãã«ã®åµåºã«ã€ãªãã£ãŠããŸãã
- ãµãŒããŒã¬ã¹ã³ã³ãã¥ãŒãã£ã³ã°ã®æ¡çšïŒ ãµãŒããŒã¬ã¹ã³ã³ãã¥ãŒãã£ã³ã°ã¯APIã®éçºãšãããã€ãç°¡çŽ åããã¹ã±ãŒã©ãã«ã§ã³ã¹ãå¹çã®é«ãã¢ããªã±ãŒã·ã§ã³ã®æ§ç¯ã容æã«ããŠããŸãã
- æ°ããAPIæè¡ã®åºçŸïŒ GraphQLãgRPCãªã©ã®æ°ããAPIæè¡ã¯ãAPIãæ§ç¯ãæ¶è²»ããããã®ããå¹ççã§æè»ãªæ¹æ³ãæäŸããŠããŸãã
çµè«
仿¥ã®ã°ããŒãã«ã«çžäºæ¥ç¶ãããäžçã§ãå ç¢ã§ã¹ã±ãŒã©ãã«ããã€ä¿å®æ§ã®é«ãã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããããã«ã¯ãAPIçµ±åãã¿ãŒã³ãçè§£ããããšãäžå¯æ¬ ã§ããèŠä»¶ãæ éã«æ€èšããé©åãªçµ±åãã¿ãŒã³ãéžæããããšã§ãAPIé§åãããžã§ã¯ãã®æåã確å®ã«ããããšãã§ããŸããAPIçµ±åãèšèšããã³å®è£ ããéã«ã¯ãã»ãã¥ãªãã£ãããã©ãŒãã³ã¹ãã¹ã±ãŒã©ããªãã£ãåªå ããããšãå¿ããªãã§ãã ãããæ£ããã¢ãããŒããçšããã°ãAPIã®åãæŽ»çšããŠãã°ããŒãã«ãªèŠèŽè åãã«é©æ°çã§ã€ã³ãã¯ãã®ãããœãªã¥ãŒã·ã§ã³ãäœæã§ããŸãã
ãã®ã¬ã€ãã¯ãããŸããŸãªAPIçµ±åãã¿ãŒã³ãçè§£ãå®è£ ããããã®åºç€ãæäŸããŸãããããžã§ã¯ãã«é¢é£ããç¹å®ã®æè¡ããã©ãããã©ãŒã ã«ã€ããŠããã«èª¿æ»ããããšã匷ããå§ãããŸãã